﻿using M_Quality.API.Application.Command.QIQPRelationCommand;
using M_Quality.Repository.Interface;
using MediatR;

namespace M_Quality.API.Application.CommandHandler.QIQPRelationCommandHandler
{
    public class AddQIQPRCommandHandler : IRequestHandler<AddQIQPRCommand, int>
    {
        private readonly IQIQPRelationRepository qIQPRelationRepository;

        public AddQIQPRCommandHandler(IQIQPRelationRepository qIQPRelationRepository)
        {
            this.qIQPRelationRepository = qIQPRelationRepository;
        }

        public async Task<int> Handle(AddQIQPRCommand request, CancellationToken cancellationToken)
        {
            return await qIQPRelationRepository.AddQIQPRAsync(request);
        }
    }
}
